package com.jpemartin.jgt;

/** Fire control that fires at random, with the given probability **/
public class FireRandom implements FireControl {
   
   protected double probFire;
   
   public FireRandom(double probabilityOfFiring) {
      probFire = probabilityOfFiring;
   }
   
   /** fire with the given probability **/
   public boolean shouldFire() {
      return (Math.random()<probFire);
   }
   
   
   
   
}
